package com.atwork.wuhua.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.TextView;

import com.atwork.wuhua.R;
import com.atwork.wuhua.bean.MyFollowBean;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.luck.picture.lib.tools.Constant;

import java.util.List;

public class MyFollowAdapter extends BaseQuickAdapter<MyFollowBean, BaseViewHolder> {
    private Context context;

    public MyFollowAdapter(Context context, int layoutResId, @Nullable List<MyFollowBean> data) {
        super(layoutResId, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, MyFollowBean item) {
        helper.addOnClickListener(R.id.img_thumb).addOnClickListener(R.id.tv_follow);


        if (item.getName().equals("1")) {
            helper.getView(R.id.tv_follow).setSelected(true);
            helper.setText(R.id.tv_follow, "关注");
            ((TextView) helper.getView(R.id.tv_follow)).setTextColor(context.getResources().getColor(R.color.white));
        } else {
            helper.getView(R.id.tv_follow).setSelected(false);
            helper.setText(R.id.tv_follow, "已关注");
            ((TextView) helper.getView(R.id.tv_follow)).setTextColor(context.getResources().getColor(R.color.A666));

        }
    }
}
